package com.oocl.chat.util;

import java.io.ObjectOutputStream;
import java.util.HashMap;
import java.util.Map;

import com.oocl.thread.SocketListener;
/**
 * 单例模式 维护map
 * @author Evan
 *
 */

public class MaintainMap {
	private static Map<String, ObjectOutputStream> map = new HashMap<String,  ObjectOutputStream>();

	public  Map<String, ObjectOutputStream> getMap() {
		return map;
	}

	public  void setMap(Map<String, ObjectOutputStream> map) {
		MaintainMap.map = map;
	}

	private static MaintainMap instance;

	private MaintainMap() {

	}
	// 懒加载单例模式
	public static MaintainMap getInstance() { 
		if (instance == null) {
			synchronized (MaintainMap.class) {
				if (instance == null)
					instance = new MaintainMap();
			}
		}
		return instance;
	}
	
}
